/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.easoft.code.pos.ui.bind;

import java.lang.reflect.Method;
import javax.swing.JComponent;

/**
 *
 * @author Eliu
 */
public class UIBinder {

    private Method tarMethod;
    private Object tarObject;
    private JComponent tarInput;
    private boolean required;
    private String label;

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public boolean isRequired() {
        return required;
    }

    public void setRequired(boolean required) {
        this.required = required;
    }

    public Method getTarMethod() {
        return tarMethod;
    }

    public void setTarMethod(Method tarMethod) {
        this.tarMethod = tarMethod;
    }

    public Object getTarObject() {
        return tarObject;
    }

    public void setTarObject(Object tarObject) {
        this.tarObject = tarObject;
    }

    public JComponent getTarInput() {
        return tarInput;
    }

    public void setTarInput(JComponent tarInput) {
        this.tarInput = tarInput;
    }

    public UIBinder(Method tarMethod, Object tarObject, JComponent tarInput) {
        this.tarMethod = tarMethod;
        this.tarObject = tarObject;
        this.tarInput = tarInput;
    }

    public UIBinder(Method tarMethod, Object tarObject, JComponent tarInput, boolean required, String label) {
        this.tarMethod = tarMethod;
        this.tarObject = tarObject;
        this.tarInput = tarInput;
        this.required = required;
        this.label = label;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final UIBinder other = (UIBinder) obj;
        return other.getTarObject().equals(this.getTarObject());
    }

}
